package com.platform.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.platform.entity.SmsLogVo;
import com.platform.entity.SonGoods;
import com.platform.entity.UserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 用户
 *
 * @author lipengjun
 * @email 939961241@qq.com
 * @date 2017-03-23 15:22:06
 */

@Mapper
public interface ApiUserMapper extends BaseDao<UserVo> {
    UserVo queryByMobile(String mobile);

    UserVo queryByOpenId(@Param("openId") String openId);

    /**
     * 获取用户最后一条短信
     *
     * @param user_id
     * @return
     */
    SmsLogVo querySmsCodeByUserId(@Param("user_id") Long user_id);

    /**
     * 保存短信
     *
     * @param smsLogVo
     * @return
     */
    int saveSmsCodeLog(SmsLogVo smsLogVo);

    /**
     * 更新分销比例
     * @param vo
     * @return
     */
    int updatefx(UserVo vo);

    IPage<UserVo> findSons(IPage<UserVo> page, @Param("params")  Map params);

    IPage<UserVo> getAllSon(IPage<UserVo> page, @Param("params")  Map params);

    List<SonGoods> findSonGoods(@Param("mlsUserId") Long mlsUserId);

    int addUserWeek(Map params);

    int addUserMonth(Map params);

    int addUserAll(Map params);

    /**
     * 查找推荐人都是vip以上的集合list
     * @param params
     * @return
     */
    List<UserVo> queryPromoterVipList(Map<String, Object> params);

    /**
     * 查找推荐人集合list
     * @param params
     * @return
     */
    List<UserVo> queryPromoterList(Map<String, Object> params);
}

